/**
 * name: mabel xu
 * date: april 11, 2008
 * filename: Item.java
 * description: implements the "Item" being stored in the HashTable
 * 				(consists of ID and amount in inventory)
 */

public class Item implements Comparable
{
	private int id;
	private int inv;

	public Item(int a, int b)
	{
		id = a;
		inv = b;
	}

	public int getId()
	{
		return id;
	}

	public int getInv()
	{
		return inv;
	}

	public boolean equals(Object obj)
	{
		return (this.compareTo(obj) == 0);
	}

	public int hashCode()
	{
		return id;
	}

	public int compareTo(Object obj)
	{
		Item o = (Item) obj;
		return (new Integer(this.getId()).compareTo(new Integer(o.getId())));
	}
}